﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QLNHBUS;
using QLNHDAO;

namespace PMQLNhaHang
{
    public partial class fmQLKVBAnBanAn : Form
    {
        private int _maKhuVuc;
        public fmQLKVBAn formParent;
        public fmQLKVBAnBanAn()
        {
            InitializeComponent();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void btnXacNhan_Click(object sender, EventArgs e)
        {
            BanAn ba = new BanAn();
            ba.Ten = tbTenBanAn.Text;
            ba.Xoa = false;
            ba.MaKhuVuc = _maKhuVuc;
            BanAnBUS.ThemBanAn(ba);
            if (formParent != null)
            {
                formParent.ReloadBA();
            }
            this.Hide();
        }
        public void NhanMaKhuVuc(int maKhuVuc)
        {
            this._maKhuVuc = maKhuVuc;
        }
    }
}
